/*
 * SalesHistoryFrame.java
 *
 * Created on 28-06-2011, 10:56:36
 */
package ui.gui;

import ui.gui.table.model.SalesHistoryTableModel;
import ui.gui.table.renderer.DecimalCellRenderer;

/**
 *
 * @author Martin Mohr Pedersen
 */
public class SalesHistoryFrame extends javax.swing.JFrame {

    private SalesHistoryTableModel tableModel;

    /** Creates new form SalesHistoryFrame */
    public SalesHistoryFrame() {
        initComponents();
        initTable();
    }

    public void initTable (){
        tableModel = new SalesHistoryTableModel();
        tblSalesHistory.setModel(tableModel);

        tblSalesHistory.setDefaultRenderer(java.lang.Double.class, new DecimalCellRenderer(2));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlSalesHistory = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblSalesHistory = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        tblSalesHistory.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(tblSalesHistory);

        javax.swing.GroupLayout pnlSalesHistoryLayout = new javax.swing.GroupLayout(pnlSalesHistory);
        pnlSalesHistory.setLayout(pnlSalesHistoryLayout);
        pnlSalesHistoryLayout.setHorizontalGroup(
            pnlSalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
        );
        pnlSalesHistoryLayout.setVerticalGroup(
            pnlSalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlSalesHistory, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlSalesHistory, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel pnlSalesHistory;
    private javax.swing.JTable tblSalesHistory;
    // End of variables declaration//GEN-END:variables
}
